package com.csdj.sc.provider.controller;

import com.csdj.sc.common.annonation.Role;
import com.csdj.sc.common.constant.RoleConstant;
import com.csdj.sc.common.entity.User;
import org.springframework.web.bind.annotation.*;

@RestController
public class TestController {

    @GetMapping("/hello")
    public String test(){
        return "hello world";
    }

    @GetMapping("/user/{addr}")
//    @Role(roles = {RoleConstant.ROLE_MANAGER,RoleConstant.ROLE_USER})
    public User getUser(@RequestParam("name")String name, @PathVariable("addr")String addr){
        User user = new User();
        user.setUsername(name);
        return user;
    }


}
